execute as @s[type=item_frame,nbt={Tags:["entity_bouncer"],ItemRotation:0b}] at @s run execute at @s as @e[distance=..1] run data modify entity @s Motion set value [1d,0.02d,-1d]
execute as @s[type=item_frame,nbt={Tags:["entity_bouncer"],ItemRotation:1b}] at @s run execute at @s as @e[distance=..1] run data modify entity @s Motion set value [1d,0.02d,0d]
execute as @s[type=item_frame,nbt={Tags:["entity_bouncer"],ItemRotation:2b}] at @s run execute at @s as @e[distance=..1] run data modify entity @s Motion set value [1d,0.02d,1d]
execute as @s[type=item_frame,nbt={Tags:["entity_bouncer"],ItemRotation:3b}] at @s run execute at @s as @e[distance=..1] run data modify entity @s Motion set value [0d,0.02d,1d]
execute as @s[type=item_frame,nbt={Tags:["entity_bouncer"],ItemRotation:4b}] at @s run execute at @s as @e[distance=..1] run data modify entity @s Motion set value [-1d,0.02d,1d]
execute as @s[type=item_frame,nbt={Tags:["entity_bouncer"],ItemRotation:5b}] at @s run execute at @s as @e[distance=..1] run data modify entity @s Motion set value [-1d,0.02d,0d]
execute as @s[type=item_frame,nbt={Tags:["entity_bouncer"],ItemRotation:6b}] at @s run execute at @s as @e[distance=..1] run data modify entity @s Motion set value [-1d,0.02d,-1d]
execute as @s[type=item_frame,nbt={Tags:["entity_bouncer"],ItemRotation:7b}] at @s run execute at @s as @e[distance=..1] run data modify entity @s Motion set value [0d,0.02d,-1d]

execute as @s[type=item_frame,nbt={Tags:["entity_bouncer_bottom"],ItemRotation:0b}] at @s run execute at @s as @e[distance=..1] run data modify entity @s Motion set value [1d,0.02d,1d]
execute as @s[type=item_frame,nbt={Tags:["entity_bouncer_bottom"],ItemRotation:1b}] at @s run execute at @s as @e[distance=..1] run data modify entity @s Motion set value [1d,0.02d,0d]
execute as @s[type=item_frame,nbt={Tags:["entity_bouncer_bottom"],ItemRotation:2b}] at @s run execute at @s as @e[distance=..1] run data modify entity @s Motion set value [1d,0.02d,-1d]
execute as @s[type=item_frame,nbt={Tags:["entity_bouncer_bottom"],ItemRotation:3b}] at @s run execute at @s as @e[distance=..1] run data modify entity @s Motion set value [0d,0.02d,-1d]
execute as @s[type=item_frame,nbt={Tags:["entity_bouncer_bottom"],ItemRotation:4b}] at @s run execute at @s as @e[distance=..1] run data modify entity @s Motion set value [-1d,0.02d,-1d]
execute as @s[type=item_frame,nbt={Tags:["entity_bouncer_bottom"],ItemRotation:5b}] at @s run execute at @s as @e[distance=..1] run data modify entity @s Motion set value [-1d,0.02d,0d]
execute as @s[type=item_frame,nbt={Tags:["entity_bouncer_bottom"],ItemRotation:6b}] at @s run execute at @s as @e[distance=..1] run data modify entity @s Motion set value [-1d,0.02d,1d]
execute as @s[type=item_frame,nbt={Tags:["entity_bouncer_bottom"],ItemRotation:7b}] at @s run execute at @s as @e[distance=..1] run data modify entity @s Motion set value [0d,0.02d,1d]

execute as @s[type=item_frame,nbt={Tags:["entity_up_bouncer"]}] at @s run execute at @s as @e[distance=..1] run data modify entity @s Motion set value [0d,1d,0d]

execute at @s if entity @e[type=!item_frame,distance=..1,type=!player] run tag @e[distance=..1.5,type=item_frame,nbt={Tags:["wire"]},tag=hasPower,limit=1,sort=random] remove hasPower